package page
{
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.events.Event;
	
	public class Page extends Sprite
	{
		private var _displayParent:DisplayObjectContainer;

		private var _isExiting:Boolean;
		
		public function Page(parent:DisplayObjectContainer)
		{
			super();
			_displayParent = parent;
		}
		
		final public function startExiting():void
		{
			_isExiting = true;
		}
		
		final public function isExiting():Boolean
		{
			return _isExiting;
		}
		
		public function enter():void
		{
			this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
			_displayParent.addChild(this);
		}
		
		public function exit():void
		{
			this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
			_displayParent.removeChild(this);
		}
		
		protected function onEnterFrame(e:Event):void
		{
		}
		
	}
}